package com.zwy.space.mapper;

import com.zwy.space.domain.Blog;
import com.zwy.space.domain.BlogType;
import com.zwy.space.queryVo.BlogDetailVo;
import com.zwy.space.queryVo.BlogVo;
import com.zwy.space.queryVo.IndexVo;
import com.zwy.space.queryVo.RecommendVo;
import com.zwy.space.queryVo.admin.SearchBlogVo;
import com.zwy.space.queryVo.admin.ShowBlog;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface BlogMapper {
    List<IndexVo> findBlogsByPage(int start, int rows);

    List<RecommendVo> findRecommendBlogs();

    BlogDetailVo findBlogById(int blogId);

    List<IndexVo> searchBlogs(String query);

    List<BlogVo> findAllBlogs();

    List<BlogType> findAllTypes();

    List<BlogVo> findBlogsBySerach(SearchBlogVo searchBlogVo);

    int saveBlog(Blog blog);

    Blog editBlogById(int blogId);

    int updateBlog(ShowBlog showBlog);

    void deleteBlog(int id);
}
